//
// Created by user on 20-4-5.
//

#include "SystemService.h"

systemCallT systemCallTable[MAX_SYSTEM_CALL_NR] =
        {
                [0] = noSystemCall,
                [1] = sysPrintf,
                [2 ... MAX_SYSTEM_CALL_NR-1] = noSystemCall
        };

long noSystemCall(PerformSite *regs) {

    printfColor(INDIGO, BLACK, "noSystemCall is calling, NR: %lx\n", regs->rax);

    return -1;
}

unsigned long sysPrintf(PerformSite *regs) {

    printfColor(INDIGO, BLACK, "strAdd: %lx\n", regs->rdi);
    printfColor(BLUE, BLACK, (char *) regs->rdi);

    return 1;
}